<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>重新推送</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <form id="pushForm">
        <div class="fieldset1 tabel_col clearFix">
            <div class="fieldBox col_50">
                <div class="label">邮箱</div>
                <div class="field">
                    <input name="email" id="email" type="text" class="ui-textbox" value="${email}"
                           validate="{required:true}">
                </div>
            </div>
        </div>
    </form>
</div>

<script type="text/javascript">
    var applyId = "${applyId}";
    // 定义父级调用事件
    frameElement.dialog.onOk = function () {
        pushAgain();
    }
    frameElement.dialog.onCancel = function () {
        frameElement.dialog.close();
    }

    $(function() {
        $("#pushForm").ligerForm({
        });
    });

    // 重新推送
    function pushAgain() {
        var email = $("#email").val();
        if (!email) {
            UIUtils.alertWarning("请填写邮箱");
            return false;
        }
        $.ajax({
            type: 'post',
            data: {applyId: applyId, email: email},
            dataType: 'json',
            url: '<%=path%>/invoice/electron/pushAgain.do',
            success: function (msg) {
                if (1 == msg.success) {
                    $.ligerDialog.SQalert({content: msg.info, SQ_showButtons: true, SQ_type: "success", onClose: function () {
                            frameElement.dialog.close();
                        }});
                    // UIUtils.alertSuccess(msg.info);
                    // frameElement.dialog.close();
                } else {
                    UIUtils.alertError(msg.info);
                }
            }
        });
    }
</script>
</body>
</html>
